---
layout: null
---

'use strict';
const application = angular.module("application", ['ngMaterial'])
.config(['$mdThemingProvider', function ($mdThemingProvider) {
{%- assign siteColor = site.color | default: 'green' | slugify %}
  let color = "{{ siteColor }}";
  $mdThemingProvider.theme(color).primaryPalette(color).accentPalette(color).warnPalette('red');
  let palette = $mdThemingProvider._PALETTES[color];
{%- comment %}/* самые яркие цвета делаем темнее */{% endcomment %}
{%- if siteColor == 'yellow' or siteColor == 'grey' %}
  palette['50'] = palette['100'];
  palette['100'] = palette['200'];
  palette['200'] = palette['300'];
  palette['300'] = palette['400'];
  palette['400'] = palette['600']; // !!!!
  palette['500'] = palette['600'];
  palette['600'] = palette['700'];
  palette['700'] = palette['800'];
  palette['800'] = palette['900'];
{%- endif %}
  let style =
    "md-toolbar.md-" + color + "-theme {" +
    "  background:" +
    "  repeating-linear-gradient(30deg, #0000 0px, " + palette['600'] + " 1px, #0000 2px, #0000 10px, " + palette['600'] + " 11px, #0000 12px, #0000 37px)," +
    "  repeating-linear-gradient(60deg, #0000 0px, " + palette['600'] + " 1px, #0000 2px, #0000 10px, " + palette['600'] + " 11px, #0000 12px, #0000 37px)," +
    "  repeating-linear-gradient(300deg, #0000 0px, " + palette['600'] + " 1px, #0000 2px, #0000 10px, " + palette['600'] + " 11px, #0000 12px, #0000 37px)," +
    "  repeating-linear-gradient(330deg, #0000 0px, " + palette['600'] + " 1px, #0000 2px, #0000 10px, " + palette['600'] + " 11px, #0000 12px, #0000 37px)," +
    "  linear-gradient(to top, " + palette['500'] + " 0%, " + palette['400'] + " 100%);" +
    "} " +
    "md-content.md-" + color + "-theme {" +
    "  color:" + palette['900'] + ";" +
    "  background-color:" + palette['50'] + ";" +
    "} " +
    ".md-fab.scroll-fab.md-" + color + "-theme {" +
{%- comment %}/* белая кнопка для холодных тем */{% endcomment %}
{%- if siteColor != 'lime' and siteColor != 'yellow' and siteColor != 'amber' and siteColor != 'orange' %}
    "  color: rgba(255,255,255,0.87) !important;" +
{%- endif %}
    "  background-color:" + palette['600'] + ";" +
    "} " +
    ".color-tomato.md-" + color + "-theme {" +
    "  --color1: " + palette['400'] + ";" +
    "  --color2: " + palette['100'] + ";" +
    "}";
  $mdThemingProvider.registerStyles(style);
}]);
